<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="order/include :: header"></head>

<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
					    <!-- <div class="columns pull-right" role="group">
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-edit" aria-hidden="true"></i>选择非直邮清单
							</button>
						</div> -->
						<div class="form-horizontal m-t" id="signupForm">
							<input type="hidden" th:value="${nodirectList.id}" id="id" name="id">
							<table class="table table-bordered table-condensed">
								<tbody>
								<tr>
									<th class="required" >ID:</th>
									<td th:text="${nodirectList.id}"></td>
									<th class="required" >名称:</th>
									<td th:text="${nodirectList.listName}"></td>
									<th class="required" >时间范围:</th>
									<td th:text="${#dates.format(nodirectList.orderStime,'yyyy-MM-dd HH:mm:ss')}+'至'+${#dates.format(nodirectList.orderEtime,'yyyy-MM-dd HH:mm:ss')}"></td>
								</tr>
								<tr>
									<th class="required" >地区:</th>
									<td th:text="${nodirectList.province}+${nodirectList.city}"></td>
									<th class="required" >创建时间:</th>
									<td th:text="${#dates.format(nodirectList.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
									<th class="required" >备注:</th>
									<td th:text="${nodirectList.remark}"></td>
								</tr>
								</tbody>
							</table>
						</div>

						<div class="ibox-title">
							<h5 >商品总数量：<span th:text="${nodirectList.totalProdNum}"></span></h5>
						</div>
						<div class="form-horizontal m-t">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th>货号</th>
										<th>属性</th>
										<th>分类</th>
										<th>ID</th>
										<th>名称</th>
										<th>规格</th>
										<th>商品类型</th>
										<th>数量</th>
										<th width="23%">操作</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item, itemStat:${nodirectList.nodirectRecords}">
									<td th:text="${item.code}"></td>
									<td th:switch="${item.isbig}"><span th:case="'1'">大件</span><span th:case="'0'">散货</span></td>
									<td th:text="${item.categoryName}"></td>
									<td th:text="${item.productId}"></td>
									<td th:text="${item.productName}"></td>
									<td th:text="${item.specTitle}"></td>
									<td th:text="${item.productType}"></td>
									<td th:text="${item.factNum}"></td>
									<td align="center">
									    <a class="btn btn-primary btn-sm" href="#" title="线路明细" onclick="comSortingLine(this)">
									       <input type="hidden" th:value="${item.productId}" name="productId">
									       <input type="hidden" th:value="${item.skuId}" name="skuId">
									       <i class="fa fa-edit"></i>线路明细
									    </a>
									    <a class="btn btn-primary btn-sm" href="#" title="门店明细" onclick="commanderDetail(this)">
									       <input type="hidden" th:value="${item.productId}" name="productId">
											<input type="hidden" th:value="${item.skuId}" name="skuId">
									       <i class="fa fa-edit"></i>门店明细
									    </a>
									</td>
								</tr>
								</tbody>
							</table>
							<table>

							</table>
							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<div class="btn btn-danger" onclick="closeDow()"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="order/include::footer"></div>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}

		var prefix = "/nodirectList/manage";
		
		function comSortingLine(obj) {
			var id = $('#id').val();
			var productId = obj.children[0].value;
			var skuId = obj.children[1].value;
		    layer.open({
		        id:'nodirectt_comSortingLine',
		        type : 2,
		        title : '线路明细',
		        maxmin : true,
		        shadeClose : false,
		        area : [ '70%', '95%' ],
		        content : prefix + '/comSortingLine?id='+ id + "&productId="+ productId + "&skuId="+ skuId
		    });
		}
		
		function commanderDetail(obj) {
			var id = $('#id').val();
			var productId = obj.children[0].value;
			var skuId = obj.children[1].value;
		    layer.open({
		        id:'nodirectt_commanderDetail',
		        type : 2,
		        title : '门店明细',
		        maxmin : true,
		        shadeClose : false,
		        area : [ '70%', '95%' ],
		        content : prefix + '/commanderDetail?id='+id + "&productId="+ productId + "&skuId="+ skuId
		    });
		}
	</script>
</body>
</html>
